﻿<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="urn:schemas-microsoft-com:office:spreadsheet"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
                xmlns:sp="http://schemas.microsoft.com/sharepoint/"
                exclude-result-prefixes="msxsl">
  <xsl:output method="xml" indent="yes"/>

  <!--
===================================================================================================================
  Onglet [Instance de liste]
===================================================================================================================
-->
  <xsl:template name="Onglet_ListInstance">
    <Worksheet ss:Name="Instance de liste">
      <Table>
        <Row>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">Url</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">Title</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">TemplateType</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">FeatureId</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">HostingFeatureId</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">HostingFeatureName</Data>
          </Cell>
          <Cell ss:StyleID="headerStyle">
            <Data ss:Type="String">SolutionId</Data>
          </Cell>
        </Row>
        <xsl:apply-templates select="//ListInstance"/>
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"/>
    </Worksheet>
  </xsl:template>

  <!--
===================================================================================================================
  Template [ListInstance]
===================================================================================================================
-->
  <xsl:template match="ListInstance">
    <Row>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="@Url"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="@Title"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="@TemplateType"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="@FeatureId"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="ancestor::*[name() = 'Feature']/@Id"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="ancestor::*[name() = 'Feature']/@Title"/>
        </Data>
      </Cell>
      <Cell>
        <Data ss:Type="String">
          <xsl:value-of select="ancestor::*[name() = 'Solution']/@Id"/>
        </Data>
      </Cell>
    </Row>
  </xsl:template>

</xsl:stylesheet>
